package com.shootforthestars.objects;

import java.util.ArrayList;
import java.util.List;


/**
 * @author jmcomets
 */
public class AffectingObstacle extends Obstacle {
	private List<RocketEffect> effects;
	private boolean alive;
	
	public AffectingObstacle() {
		super();
		effects = new ArrayList<RocketEffect>();
		alive = false;
	}
	
	@Override
	public void onHitRocket(Rocket rocket) {
		for (RocketEffect e : effects) {
			e.applyToRocket(rocket);
		}
	}

	@Override
	public boolean isAlive() {
		return alive;
	}
	
	public void setAlive(boolean alive) {
		this.alive = alive;
	}
	
	public void addEffect(RocketEffect e) {
		effects.add(e);
	}
}
